home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / AIncludes / Keyboard.a < prev    next >
Text File  |  1996-05-01  |  5KB  |  176 lines

  1. ;
  2. ;    File:        Keyboard.a
  3. ;
  4. ;    Contains:    interfaces for keyboard componets
  5. ;
  6. ;    Version:    Technology:    
  7. ;                Release:    Universal Interfaces 3.0d3 on Copland DR1
  8. ;
  9. ;    Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10. ;
  11. ;    Bugs?:        If you find a problem with this file, send the file and version
  12. ;                information (from above) and the problem description to:
  13. ;
  14. ;                    Internet:    apple.bugs@applelink.apple.com
  15. ;                    AppleLink:    APPLE.BUGS
  16. ;
  17. ;
  18.     IF &TYPE('__KEYBOARD__') = 'UNDEFINED' THEN
  19. __KEYBOARD__ SET 1
  20.  
  21.     IF &TYPE('__CONDITIONALMACROS__') = 'UNDEFINED' THEN
  22.     include 'ConditionalMacros.a'
  23.     ENDIF
  24.     IF &TYPE('__EVENTS__') = 'UNDEFINED' THEN
  25.     include 'Events.a'
  26.     ENDIF
  27.     IF &TYPE('__IOITERATOR__') = 'UNDEFINED' THEN
  28.     include 'IOIterator.a'
  29.     ENDIF
  30.     IF &TYPE('__TIMING__') = 'UNDEFINED' THEN
  31.     include 'Timing.a'
  32.     ENDIF
  33.     IF FOR_SYSTEM8_PREEMPTIVE THEN
  34. ;  Virtual ID for a keyboard  
  35. ; typedef UInt32                         KeyboardID
  36.  
  37. ;  System 8.x version of of a Keymap 
  38. KeyboardMap                RECORD 0
  39. elements                 ds.b    32
  40. sizeof                     EQU *                    ; size:   $20 (32)
  41.                         ENDR
  42.  
  43.  
  44. ;  System 8.x version of a virtual key 
  45. ; typedef UInt8                         VirtualKeyCode
  46.  
  47. ;  System 8.x definition of keyboard modifiers 
  48. ; typedef UInt16                         KeyboardModifiers
  49.  
  50. ;  System 8.x definition of keyboard direction 
  51.  
  52. kKeyDirectionKeyDown            EQU        $0001
  53. kKeyDirectionKeyUp                EQU        $0002
  54. kKeyDirectionAutoKeyDown        EQU        $0003
  55. ; typedef short                         KeyDirection
  56.  
  57. ; typedef UInt32                         KeyboardDeviceMode
  58.  
  59. ;  Keyboard Event returned from I/O subsystem 
  60. LowLevelKeyEvent        RECORD 0
  61. theBoard                 ds.l    1                ; offset: $0 (0)
  62. theKey                     ds.b    1                ; offset: $4 (4)
  63. filler1                     ds.b    1                ; offset: $5 (5)
  64. direction                 ds.w    1                ; offset: $6 (6)
  65. modifiers                 ds.w    1                ; offset: $8 (8)
  66. theEventTime             ds        AbsoluteTime    ; offset: $A (10)
  67. sizeof                     EQU *                    ; size:   $12 (18)
  68.                         ENDR
  69.  
  70. kKeyboardHardwareTypeUnknown    EQU        0
  71. kKeyboardHardwareTypeADB        EQU        1
  72. kKeyboardHardwareTypeSerial        EQU        2
  73. ; typedef UInt32                         KeyboardHardwareType
  74.  
  75. KeyboardIOIteratorData    RECORD 0
  76. IOCommon                 ds        IOCommonInfo    ; offset: $0 (0)
  77. theType                     ds.l    1                ; offset: $14 (20)
  78. keycount                 ds.l    1                ; offset: $18 (24)
  79. kcapResID                 ds.l    1                ; offset: $1C (28)
  80. hasNumericKeypad         ds.b    1                ; offset: $20 (32)
  81. hasLEDFeedback             ds.b    1                ; offset: $21 (33)
  82. sizeof                     EQU *                    ; size:   $22 (34)
  83.                         ENDR
  84. KeyboardDeviceRecord    RECORD 0
  85. f                         ds        KeyboardIOIteratorData
  86. sizeof                     EQU *                    ; size:   $22 (34)
  87.                         ENDR
  88.  
  89.  
  90.  
  91. kKeyboardLEDOff                    EQU        0
  92. kKeyboardLEDOn                    EQU        1
  93. ; typedef Boolean                         KeyboardLEDState
  94.  
  95.  
  96. kKeyboardLEDNumLock                EQU        0
  97. kKeyboardLEDCapsLock            EQU        1
  98. kKeyboardLEDScrollLock            EQU        2
  99. ; typedef short                         KeyboardLEDSelector
  100.  
  101. ;
  102. ; extern OSStatus GetKeyMap(KeyboardID theID, KeyboardMap theMap)
  103. ;
  104.     IF GENERATINGCFM THEN
  105.         IMPORT_CFM_FUNCTION GetKeyMap
  106.     ENDIF
  107.  
  108. ;
  109. ; extern OSStatus KeyboardIsKeyDown(VirtualKeyCode theKey, KeyDirection *keyState, KeyboardModifiers *modifierState)
  110. ;
  111.     IF GENERATINGCFM THEN
  112.         IMPORT_CFM_FUNCTION KeyboardIsKeyDown
  113.     ENDIF
  114.  
  115. ;  Warning: This routine is intended only for clients who need to bypass the events system altogether. 
  116. ;
  117. ; extern OSStatus GetNextLowLevelKeyEvent(LowLevelKeyEvent *theKey)
  118. ;
  119.     IF GENERATINGCFM THEN
  120.         IMPORT_CFM_FUNCTION GetNextLowLevelKeyEvent
  121.     ENDIF
  122.  
  123. ;
  124. ; extern OSStatus GetLastKeypressTime(AbsoluteTime *theTime)
  125. ;
  126.     IF GENERATINGCFM THEN
  127.         IMPORT_CFM_FUNCTION GetLastKeypressTime
  128.     ENDIF
  129.  
  130. ;
  131. ; extern OSStatus GetKeyboardLEDStatus(KeyboardID theID, short theLight, Boolean *value)
  132. ;
  133.     IF GENERATINGCFM THEN
  134.         IMPORT_CFM_FUNCTION GetKeyboardLEDStatus
  135.     ENDIF
  136.  
  137. ;
  138. ; extern OSStatus SetKeyboardLEDStatus(KeyboardID theID, short theLight, Boolean value)
  139. ;
  140.     IF GENERATINGCFM THEN
  141.         IMPORT_CFM_FUNCTION SetKeyboardLEDStatus
  142.     ENDIF
  143.  
  144. ;
  145. ; extern OSStatus GetKeyboardDeviceMode(KeyboardID theID, KeyboardDeviceMode *theMode)
  146. ;
  147.     IF GENERATINGCFM THEN
  148.         IMPORT_CFM_FUNCTION GetKeyboardDeviceMode
  149.     ENDIF
  150.  
  151. ;
  152. ; extern OSStatus SetKeyboardDeviceMode(KeyboardID theID, KeyboardDeviceMode theMode)
  153. ;
  154.     IF GENERATINGCFM THEN
  155.         IMPORT_CFM_FUNCTION SetKeyboardDeviceMode
  156.     ENDIF
  157.  
  158. ;  Device Iteration 
  159. ;
  160. ; extern OSStatus GetKeyboardDeviceRecord(KeyboardID theID, KeyboardDeviceRecord *theDeviceRecord)
  161. ;
  162.     IF GENERATINGCFM THEN
  163.         IMPORT_CFM_FUNCTION GetKeyboardDeviceRecord
  164.     ENDIF
  165.  
  166. ;
  167. ; extern OSStatus KeyboardGetDeviceData(ItemCount requestItemCount, ItemCount *totalItemCount, KeyboardIOIteratorData *iteratorBuffer)
  168. ;
  169.     IF GENERATINGCFM THEN
  170.         IMPORT_CFM_FUNCTION KeyboardGetDeviceData
  171.     ENDIF
  172.  
  173.     ENDIF
  174.     ENDIF ; __KEYBOARD__ 
  175.  
  176.